fontchooser: fix feature formatting
authorMatthias Clasen <mclasen@redhat.com>
Thu, 4 Jan 2018 02:21:58 +0000 (21:21 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 4 Jan 2018 13:39:18 +0000 (08:39 -0500)
There was a " missing, causing some features to be missed.

gtk/gtkfontchooserwidget.c

index d021da48aae375fb6c30763a3e8e251ea0e600dc..ee5f50f0a29342909b0433aea5e213f6a9ec23a3 100644 (file)
@@ -2115,11 +2115,7 @@ update_font_features (GtkFontChooserWidget *fontchooser)
           if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)) &&
               strcmp (item->name, "xxxx") != 0)
             {
-              if (s->len > 0)
-                g_string_append (s, ", ");
-              g_string_append (s, "\"");
-              g_string_append (s, item->name);
-              g_string_append (s, "\" 1");
+              g_string_append_printf (s, "%s\"%s\" %d", s->len > 0 ? ", " : "", item->name, 1);
             }
         }
       else if (GTK_IS_CHECK_BUTTON (item->feat))
@@ -2127,14 +2123,9 @@ update_font_features (GtkFontChooserWidget *fontchooser)
           if (gtk_check_button_get_inconsistent (GTK_CHECK_BUTTON (item->feat)))
             continue;
 
-          if (s->len > 0)
-            g_string_append (s, ", ");
-          g_string_append (s, ", \"");
-          g_string_append (s, item->name);
-          if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)))
-            g_string_append (s, "\" 1");
-          else
-            g_string_append (s, " 0");
+          g_string_append_printf (s, "%s\"%s\" %d",
+                                  s->len > 0 ? ", " : "", item->name,
+                                  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item->feat)));
         }
     }